<div id="addOwnerModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">
                    <span>
                        <span><vc:i18n name="添加" namespace="addOwner"></vc:i18n></span>
                    </span>{{addOwnerInfo.componentTitle}}
                </h3>
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="姓名" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addOwnerInfo.name" type="text" :placeholder="vc.i18n('必填，请填写姓名','addOwner')" class="form-control" oninput="this.value=this.value.replace(/\s+/g, '')">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="手机" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addOwnerInfo.link" type="number" :placeholder="vc.i18n('必填，请填写联系方式','addOwner')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="身份证" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <!--@change="addOwnerIDCardChange()"-->
                                    <input v-model.trim="addOwnerInfo.idCard" type="text" :placeholder="vc.i18n('可选，请填写身份证','addOwner')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="性别" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addOwnerInfo.sex">
                                        <option selected disabled value="">{{vc.i18n('必填，请选择性别','addOwner')}}</option>
                                        <option value="0">{{vc.i18n('男','addOwner')}}</option>
                                        <option value="1">{{vc.i18n('女','addOwner')}}</option>
                                    </select>
                                </div>
                            </div>
                            <!-- <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="年龄" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model="addOwnerInfo.age" type="text" readonly="readonly" :placeholder="vc.i18n('请输入年龄','addOwner')" class="form-control">
                                </div>
                            </div> -->
                            <div class="form-group row" v-if="addOwnerInfo.componentTitle == '成员'">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="类型" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addOwnerInfo.ownerTypeCd">
                                        <option selected disabled value="">{{vc.i18n('必填，请选择类型','addOwner')}}</option>
                                        <option value="1002">{{vc.i18n('家庭成员','addOwner')}}</option>
                                        <option value="1003">{{vc.i18n('租客','addOwner')}}</option>
                                        <option value="1005">{{vc.i18n('其他','addOwner')}}</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6" style="text-align:center">
                            <div class="form-group row">
                                <div style="width: 100%;" v-show="addOwnerInfo.ownerPhotoUrl != ''">
                                    <img width="80%" height="150rem" v-bind:src="addOwnerInfo.ownerPhotoUrl" alt="vc.i18n('业主照片','addOwner')">
                                </div>
                                <div style="width: 100%;" v-show="addOwnerInfo.ownerPhotoUrl == ''">
                                    <div v-show="addOwnerInfo.videoPlaying == true">
                                        <video id="ownerPhoto" style="width: 100%;height: 10rem;"></video>
                                        <canvas id="canvas" style="display:none;"></canvas>
                                    </div>
                                    <div v-show="addOwnerInfo.videoPlaying == false">
                                        <img width="80%" height="150rem" src="/img/noPhoto.jpg" :alt="vc.i18n('业主照片','addOwner')">
                                    </div>
                                </div>
                                <div style="margin: 10px auto 0px auto;" class="text-center">
                                    <button class="btn btn-primary" type="button" v-if="addOwnerInfo.videoPlaying == true && addOwnerInfo.ownerPhotoUrl != ''" v-on:click="_reOpenVedio()">
                                        <span class="fa fa-camera"></span>
                                        <span><vc:i18n name="摄像头" namespace="addOwner"></vc:i18n></span>
                                    </button>
                                    <button class="btn btn-primary" type="button" v-if="addOwnerInfo.videoPlaying == true && addOwnerInfo.ownerPhotoUrl == ''" v-on:click="_takePhoto()">
                                        <span class="fa fa-camera"></span>
                                        <span><vc:i18n name="拍照" namespace="addOwner"></vc:i18n></span>
                                    </button>
                                    <span class="btn btn-default btn-file" v-on:click="_uploadPhoto($event)">
                                        <span class="fileinput-new">
                                            <span><vc:i18n name="上传照片" namespace="addOwner"></vc:i18n></span>
                                    </span>
                                    </span>
                                    <input type="file" class="file" accept=".jpg" id="uploadOwnerPhoto" hidden v-on:change="_choosePhoto($event)">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="家庭住址" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addOwnerInfo.address" type="text" :placeholder="vc.i18n('可填，请填写家庭住址','addOwner')" class="form-control">
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="备注" namespace="addOwner"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model.trim="addOwnerInfo.remark" type="tel" :placeholder="vc.i18n('可填，请填写备注','addOwner')" class="form-control">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div v-for="(item,index) in addOwnerInfo.attrs">
                        <div class="row" v-if="index % 2 == 0">
                            <div class="col-sm-6">
                                <div class="form-group row" v-if="item.specType == '2233'">
                                    <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                    <div class="col-sm-10">
                                        <input v-model="item.value" type="text" :placeholder="item.specHoldplace" class="form-control">
                                    </div>
                                </div>
                                <div class="form-group row" v-if="item.specType == '3344'">
                                    <label class="col-sm-2 col-form-label">{{item.specName}}</label>
                                    <div class="col-sm-10">
                                        <select class="custom-select" v-model.trim="item.value">
                                            <option selected disabled value="">{{item.specHoldplace}}</option>
                                            <option v-for="value in item.values" :label="value.valueName"
                                                    :value="value.value">{{item.valueName}}
                                            </option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6" v-if="index < addOwnerInfo.attrs.length-1">
                                <div class="form-group row" v-if="addOwnerInfo.attrs[index+1].specType == '2233'">
                                    <label class="col-sm-2 col-form-label">{{addOwnerInfo.attrs[index+1].specName}}</label>
                                    <div class="col-sm-10">
                                        <input v-model.trim="addOwnerInfo.attrs[index+1].value" type="text" :placeholder="addOwnerInfo.attrs[index+1].specHoldplace" class="form-control">
                                    </div>
                                </div>
                                <div class="form-group row" v-if="addOwnerInfo.attrs[index+1].specType == '3344'">
                                    <label class="col-sm-2 col-form-label">{{addOwnerInfo.attrs[index+1].specName}}</label>
                                    <div class="col-sm-10">
                                        <select class="custom-select" v-model.trim="addOwnerInfo.attrs[index+1].value">
                                            <option selected disabled value="">
                                                {{addOwnerInfo.attrs[index+1].specHoldplace}}
                                            </option>
                                            <option v-for="value in addOwnerInfo.attrs[index+1].values"
                                                    :label="value.valueName" :value="value.value">
                                                {{addOwnerInfo.attrs[index+1].valueName}}
                                            </option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <button class="btn btn-primary float-right" type="button" v-on:click="saveOwnerInfo()">
                            <i class="fa fa-check"></i>&nbsp;
                            <span><vc:i18n name="保存"></vc:i18n></span>
                        </button>
                        <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" @click="_closeSaveOwnerModal()">
                            <i class="fa fa-close"></i>&nbsp;
                            <span><vc:i18n name="取消"></vc:i18n></span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>